bind:
  pkg.installed:
    - name: bind
  file.managed:
    - name: /etc/named.conf
    - source: salt://bind/files/etc/named.conf
    - template: jinja
    - require: 
      - pkg: bind
  file.managed:
    - name: /var/named/autoinstall.com.zone
    - source: salt://bind/files/var/named/autoinstall.com.zone
    - template: jinja
    - require: 
      - pkg: bind
  service.running:
    - name: named
    - enable: True
    - watch:
      - pkg: bind
      - file: /etc/named.conf
    - require:
      - file: /var/log/named
/var/log/named:
  file.directory:
    - user: named
    - group: named
    - mode: 770
    - makedirs: True
    - require:
      - pkg: bind

